package basic.demo.array;

public class ArrayStudy2 {

    /**
     * 二维数组定义，赋值和遍历
     * @param args
     */
    public static void main(String[] args) {
        int[][] arr = new int[2][3];

        for (int i=0; i<2; i++)
            for (int j=0; j<3; j++) {
                arr[i][j] = i*3+j+1;
            }

        for (int j=0; j<3; j++) {
            for (int i = 0; i < 2; i++) {
                System.out.print(arr[i][j]+" ");
            }
            //换行
            System.out.println("");
        }

    }


}
